
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:icecore="http://www.icefaces.org/icefaces/core" xmlns:ui="http://java.sun.com/jsf/facelets">
    
     
	<ui:composition template="../../WEB-INF/templates/template.xhtml">


		<ui:param name="title" value="Fact Entry System"/>
        	
		<ui:define name="header">
			<ui:include src="../../WEB-INF/templates/header.xhtml"/> 
		</ui:define>
		
		<ui:define name="menu">		
			<ui:include src="../../WEB-INF/templates/menuLeft.xhtml"/>               
		</ui:define>
		
		<ui:define name="content">
			
			<style type="text/css">
			               
			.icePnlGrdFtr {
			    padding-left: 120px;
			    padding-top: 60px;
			}
							
            </style>
<script type="text/javascript">
	function deleteConfirmation(nodeId,label)
	{
		document.getElementById("deleteMsg").innerHTML="Node Name :"+label;
		document.getElementById("form:nodeId").value=nodeId;
		confirmation.show();
	}
	function setEditId(userId) 
	{

	    document.getElementById("form:editNodeId").value=userId;

	}

</script>	
            
			<h:panelGrid styleClass="managementHeaderTable" width="100%" columns="5" cellspacing="3" cellpadding="3">
            <h:outputText value="Node Attribute Management" />              
				 <h:outputText value="Segment"/>
            	 <ice:selectOneMenu styleClass="roleSelectBox"  partialSubmit="true" value="#{nodeAttributeBean.segmentId}" id="segmentId" valueChangeListener="#{nodeAttributeBean.toggleSegmentId}" >
            		        <f:selectItem itemLabel="Select a Segment" itemValue="0" />
	   						<f:selectItems value="#{segmentBean.segmentSelectList}" />
	 			 </ice:selectOneMenu>
	 			 
	 			 <h:outputText value="Node"/>
	 			 <ice:selectOneMenu styleClass="roleSelectBox"  partialSubmit="true" value="#{nodeAttributeBean.nodeId}" id="nodeId" valueChangeListener="#{nodeAttributeBean.toggleNodeId}" >
            		         <f:selectItem itemLabel="Select a Node" itemValue="0" />
	   						<f:selectItems value="#{nodeAttributeBean.nodeSelectList}" />
	 			 </ice:selectOneMenu>
	 			
	 			
	 			
	 				   
            </h:panelGrid> 

		  <!-- Paginator with page controls -->
                <ice:dataPaginator id="dataScroll_3"
                                   for="attributeList"
                                   paginator="true"
                                   fastStep="3"
                                   paginatorMaxPages="4">
                    <f:facet name="first">
                        <ice:graphicImage
                            url="../xmlhttp/css/rime/css-images/arrow-first.gif"
                            style="border:none;"
                            title="First Page"/>
                    </f:facet>
                    <f:facet name="last">
                        <ice:graphicImage
                            url="../xmlhttp/css/rime/css-images/arrow-last.gif"
                            style="border:none;"
                            title="Last Page"/>
                    </f:facet>
                    <f:facet name="previous">
                        <ice:graphicImage
                            url="../xmlhttp/css/rime/css-images/arrow-previous.gif"
                            style="border:none;"
                            title="Previous Page"/>
                    </f:facet>
                    <f:facet name="next">
                        <ice:graphicImage
                            url="../xmlhttp/css/rime/css-images/arrow-next.gif"
                            style="border:none;"
                            title="Next Page"/>
                    </f:facet>
                    <f:facet name="fastforward">
                        <ice:graphicImage url="../xmlhttp/css/rime/css-images/arrow-ff.gif"
                                          style="border:none;"
                                          title="Fast Forward"/>
                    </f:facet>
                    <f:facet name="fastrewind">
                        <ice:graphicImage url="../xmlhttp/css/rime/css-images/arrow-fr.gif"
                                          style="border:none;"
                                          title="Fast Backwards"/>
                    </f:facet>
                </ice:dataPaginator>
                
                <!-- Display counts about the table and the currently displayed page -->
                <ice:dataPaginator id="dataScroll_2" for="attributeList"
                                   rowsCountVar="rowsCount"
                                   displayedRowsCountVar="displayedRowsCount"
                                   firstRowIndexVar="firstRowIndex"
                                   lastRowIndexVar="lastRowIndex"
                                   pageCountVar="pageCount"
                                   pageIndexVar="pageIndex">
                    <ice:outputFormat
                        value="{0} Nodes found, displaying {1} Node(s) from {2} to {3}. Page {4} / {5}."
                        styleClass="standard">
                        <f:param value="#{rowsCount}"/>
                        <f:param value="#{displayedRowsCount}"/>
                        <f:param value="#{firstRowIndex}"/>
                        <f:param value="#{lastRowIndex}"/>
                        <f:param value="#{pageIndex}"/>
                        <f:param value="#{pageCount}"/>
                    </ice:outputFormat>
                </ice:dataPaginator>
                			
	      <ice:dataTable
                    rows="20"
                    id="attributeList"
                    value="#{nodeAttributeBean.attributeList}"
                    var="node" varStatus="rowInfo"  columnWidths="50px,50px,200px,200px,100px,100px,200px" >
                    
                    <!-- Serial number -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Serial"/>
                        </f:facet>

                        <ice:outputText value="#{rowInfo.index+1}"/>
                        
                    </ice:column>
                    
                    <!-- Node Id -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Node Id"/>
                        </f:facet>
                        <ice:outputText value="#{node.nodeId}"/>
                        <h:inputHidden value="#{node.scenarioid}" />
                       
            
                        
                    </ice:column>
                    
                    <!-- Data Type -->
                    <ice:column>
                        <f:facet name="header">
                            <ice:outputText value="Make Name"/>
                        </f:facet>
                        <ice:outputText value="#{node.makeName}"/>
                    </ice:column>
                                        
                    <!-- Node Name -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Scenario"/>
                        </f:facet>
                        <ice:outputText value="#{node.scenarioName}"/>
                    </ice:column>
                    
                    
                    
					<!-- Node Type -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Max. Value"/>
                        </f:facet>
                        <ice:inputText  value="#{node.maxValue}" style="width:80px;text-align: center;" maxlength="6" required="true"  tabindex="1"/>
                    </ice:column>
                    
                    <!-- Segment -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Min. Value"/>
                        </f:facet>
                        <ice:inputText value="#{node.minValue}" style="width:80px;text-align: center;" maxlength="6" required="true"  tabindex="1"/>
                    </ice:column>
                    
                    <!-- Parent Node -->
                    <ice:column styleClass="col_slNo">
                        <f:facet name="header">
                            <ice:outputText value="Active?"/>
                        </f:facet>
                        
                        <ice:selectOneRadio value="#{node.visibilityFlag}" layout="lineDirection">
                       		<f:selectItem itemValue="1" itemLabel="Active"  />
				   			<f:selectItem itemValue="0" itemLabel="Inactive" />
                        </ice:selectOneRadio> 
                       
                    </ice:column>
                    

                    
                    
                    
                    
                </ice:dataTable>
                

			    <h:commandButton id="saveButton"  actionListener="#{nodeAttributeBean.saveAttributes}"  value="Save" style="width:100px;height:30px;" />
				<h:messages  globalOnly="true"  style="color:green"/>							
         </ui:define>
		
		<ui:define name="footer">
	       <ui:include src="../../WEB-INF/templates/footer.xhtml"/> 
		</ui:define>
		
	</ui:composition>

</html>
